<template>
  <fragment>
    <template v-for="m in menuData">
      <!-- 有子菜单 -->
      <el-submenu
        :index="m.path"
        :key="m.id"
        v-if="m.children && m.children.length"
      >
        <template slot="title">
          <i class="el-icon-location"></i>
          <span slot="title">{{ m.title }}</span>
        </template>
        <MenuTree :menuData="m.children"></MenuTree>
      </el-submenu>
      <!-- 无子菜单 -->
      <el-menu-item :index="m.path" :key="m.id" v-else>
        <i class="el-icon-location"></i>
        <span slot="title">{{ m.title }}</span>
      </el-menu-item>
    </template>
  </fragment>
</template>




<script>
export default {
  name: "MenuTree",
  props: ["menuData"],
};
</script>

<style>
</style>